import request from '@/utils/request'
import qs from 'qs'
// import axios from 'axios'

// //登录验证
export function login(data) {
    return request({
        url: '/auth/accredit',
        method: 'post',
        data: qs.stringify(data)
        // headers: {
        //     'Content-Type': 'application/json;charset=UTF-8'
        // }
    })

    // return axios.get('http://mengxuegu.com:7300/mock/5f5845688d90085e5b5843f4/user/login')
}

//获取用户信息
export function getUserInfo(token) {
    return request({
        url: '/auth/verify',
        method: 'get',
        headers: {
            token
        }
    })
    // return axios.get('http://mengxuegu.com:7300/mock/5f5845688d90085e5b5843f4/user/mess')
}

//退出
export function logout() {
  return request({
      url: '/auth/logout',
      method: 'get'
  })
    // return axios.get('http://mengxuegu.com:7300/mock/5f5845688d90085e5b5843f4/user/logout')
}